package com.information.manage.basic.common.constant;

/**
 * 类型集
 * 根据不同位的bit值来确定部门属于哪些类型, 最大63个类型
 */
public enum TypeCollectionEnum {

    DEPARTMENT(0x01, "部门"),
    REGION(0x02, "区域");

    public final Long code;

    public final String des;

    TypeCollectionEnum(long code, String des){
        this.code = code;
        this.des = des;
    }

    public static TypeCollectionEnum getInstance(Long code){
        for (TypeCollectionEnum value : TypeCollectionEnum.values()) {
            if (code.equals(value.code)){
                return value;
            }
        }
        return null;
    }

    public static TypeCollectionEnum getInstance(String des){
        for (TypeCollectionEnum value : TypeCollectionEnum.values()) {
            if (des.equals(value.des)){
                return value;
            }
        }
        return null;
    }


}
